﻿
Public Class GetMeasuresResponse
    Inherits Core.WBSAPIResponse

    Private m_updateTime As DateTime
    Private m_hasMore As Boolean
    Private m_measureGroups As Generic.List(Of MeasureGroup)

    ''' <summary>
    ''' The webservices local timestamp at which the Json response was generated
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public ReadOnly Property UpdateTime() As DateTime
        Get
            Return m_updateTime
        End Get
    End Property
    ''' <summary>
    ''' True, is your query yielded too many values to fit in a single group. Current limit is 2048.
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks>If present, this field means that your query yielded too many measure groups to fit in a single response. Either you provided a limit parameter and the query yielded more groups than limit, or you didn't and the query yielded more than the default implicit limit (currently 2048 groups by query). In any case, it is up to your application to request remaining groups using measure/getmeas and providing offset parameter. The more value represents the number of remaining groups still to be fetched.</remarks>
    Public ReadOnly Property HasMore() As Boolean
        Get
            Return m_hasMore
        End Get
    End Property

    ''' <summary>
    ''' Gets the MeasureGroups with the requested values
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Public Function ReadMeasureGroups() As MeasureGroup()
        Return m_measureGroups.ToArray
    End Function

    ''' <summary>
    ''' Add a MeasureGroup to the internal Liste
    ''' </summary>
    ''' <param name="item">new group to add</param>
    ''' <remarks></remarks>
    Friend Sub AddMeasureGroup(ByVal item As MeasureGroup)
        m_measureGroups.Add(item)
    End Sub

    ''' <summary>
    ''' Creates a new measure group (for WBSAPIConector only)
    ''' </summary>
    ''' <param name="status"></param>
    ''' <param name="updateTime"></param>
    ''' <param name="hasMore"></param>
    ''' <remarks></remarks>
    Friend Sub New(ByVal status As Core.StatusResponseEnum, ByVal updateTime As DateTime, ByVal hasMore As Boolean)
        MyBase.New(status)
        m_updateTime = updateTime
        m_hasMore = hasMore
        m_measureGroups = New Generic.List(Of MeasureGroup)
    End Sub


End Class
